Introduction

Trade has been a quintessential component of human interaction since the dawn of history. In its simplest fashion we had the barter system – the exchange of goods and services without the use of money. As society developed further, and we began to explore the concept of a ‘nation’ as a unit above the individual, the scope of trade found natural extensions to the international sphere.

In its early years, trade was thought of as quite competitive, and nations believed that if one were to increase their trade, this could only be done at the cost of another. Countries actively tried to dominate in terms of exports, but minimized imports, believing this would best protect their interests. This viewpoint was overturned with the advent of liberalism, and the idea that trade should be free. As a whole, we’ve gone back and forth between these ideas over the years, and landed somewhere in the middle – free trade as far as possible, with trade agreements and global organizations to keep us all in line.

Now, international trade is an integral part of the global economy. Countries enter into economic transactions with one another whereby they are able to produce and export goods in which they have the comparative advantage and import goods that other countries have more efficient production in. Through trading, countries are able to take advantage of their different specialties, which leads to accelerated growth for their individual economies and financial markets. A long way from the barter system of old, international trade today is facilitated by large financial institutions, and in 2018 alone the total value of global exports was approximately 19.5 trillion USD.

Our Analysis

In the United States, there’s a widespread view that China is the major exporter, and the US the major importer in the global economy. But how much does China dominate the export market, and is the United States as big of a player in the import market as we think? In addition, are there natural divisions among countries in terms of trade volumes? What does the global trade network really look like? These are the questions we look to address.

These questions all relate in some way to the distribution of trade worldwide. To get a broad overview, we look first at choropleths depicting share in total exports, and in total imports, by country. This gives us a preliminary understanding, not only of how countries relate to one another in terms of exports and imports, but also of how imports and exports relate within a particular country. We then move to the second question – do natural groupings arise among countries based on trade volume? To explore this, we conduct a cluster analysis using k-means, which in turn forms the basis of a network analysis, where we look at how countries in these clusters interact, and which appear to be the most important.

Data Background

The visualizations and analysis that follow are based on worldwide trade flow data taken from CEPII, which incorporates yearly bilateral trades down to the product level. This data is directly taken from reports submitted to the United Nations Statistical Division, and includes variables such as year, product category, exporter, importer, value of the trade (in $1,000), and lastly quantity (in metric tons).

We restrict our focus particularly to the year 2017. Through grouping by exporter and importer and summing the value of trade, we are able to calculate trade volumes (in terms of value, for better comparison) between various different countries. We further use this to calculate a country’s share in total exports and imports.

World Exports and Imports

Contribution to World Exports by Country

The map above displays individual country contributions, as a percentage of total world export value. Countries in gray correspond to those for which we did not have data. As expected, China appears to dominate exports, accounting for around 14% of total world exports. The United States and Germany also contribute significantly, with each contributing more than 8% of total world exports. However the rest of the countries seem to contribute very little individually, with most accounting for less than 2% of global exports each.

Contribution to World Imports by Country

Here we look at the contributions of each country to total world imports, as a percentage. Once again, countries in gray correspond to those for which data were unavailable. We see that Germany, the United States, and China appear to be the major players. Interestingly, though China is the leading exporter in 2017, it is the United States that dominates with respect to imports, accounting for around 12% of the global total. This might indicate an interesting relationship between these two countries, which we will explore in the clustering and network analyses.

Clustering

From our initial visualizations, it seems at least that the United States, Germany, and China, are distinct in terms of exports and imports. In order to uncover any other natural groups, as well as to see if these three countries do indeed form a group, we undertake a cluster analysis using k-means – a partitioning method.

Testing the Optimal Number of Clusters

Since the k-means solution requires us to specify a number of clusters, we look at the total within group sum of squares as a metric by which to select the optimal number of clusters. Below, we plot the total within group sum of squares vs. the optimal number of clusters, looking for an “elbow” in the plot.

From this graph of within group sum of squares against the number of clusters, we can see that there is a clear “elbow” at 3 clusters, which indicates that the optimal number of clusters for our k-means solution is 3. Beyond this, an increase in number of clusters doesn’t provide us much improvement in the solution, and so would be an unnecessary increase in complexity.

Visualizing the Cluster Solution

From the graph above, we can see the large disparity between clusters, particularly with respect to the countries in cluster 2. These three countries contributed significantly more to world exports and imports than the rest of the other countries as they, on average, contribute 10% to world trade individually.

In cluster 3, the countries do contribute on average close to 2.5% of total world trade, much lower than in cluster 2 but also much higher than cluster 1 which contains most of the countries in the world but each contributed negligibly in comparison to world trade.

Trade Networks

High Trade Volume Countries

..do we want to add export in the name here..

In the network between high trade volume countries, one can more simply visualize where the exports from that country were destined to go within the cluster, as a wider arrow means a higher volume of exports to that country, and a smaller arrow means a lower volume of exports to that country. The high volume countries were selected through unsupervised learning CAN SOMEONE EXPLAIN THIS PART MORE.

Medium Trade Volume Countries

..do we want to add export in the name here..

In the network between medium trade volume countries, the export paths from each country to all countries it exports to is very easy and interesting to see here. By clicking on a country one can see if it exports more to one country than another through the thickness of the arrow and can even see if they don’t export with one specific country. This cluster was also chosen through unsupervised learning CAN SOMEONE EXPLAIN THIS PART MORE.